
const initState = [{ name: 'tom', age: 13, id: 1 }]
export default function createReducer(preState = initState, action) {
    const { type, data } = action
    if (type === 'create') {
        return [data, ...preState]
    }
    return preState
}